<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>编译liblcl | ENERGY</title>
    
    <meta name="generator" content="VitePress v1.3.4">
    <link rel="preload stylesheet" href="/assets/style.CVmrvE-Z.css" as="style">
    <script type="module" src="/assets/chunks/metadata.704ba9d8.js"></script>
    <script type="module" src="/assets/app.C45ajGbE.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/assets/chunks/theme.Dj-KnMWw.js">
    <link rel="modulepreload" href="/assets/chunks/framework.D5tr8Gic.js">
    <link rel="modulepreload" href="/assets/en_course_build-liblcl.md.C74cXyJJ.lean.js">
    <link rel="icon" href="/imgs/favicon.ico">
    <link rel="icon" type="image/png" href="/imgs/energy.png">
    <meta name="theme-color" content="#5f67ee">
    <meta name="keywords" content="ENERGY,ENERGYGUI,CEF,GOGUI">
    <meta name="description" content="ENERGY是Go基于LCL和CEF(Chromium Embedded Framework)开发的GUI框架, 用于开发Windows、MacOS 和 Linux 跨平台桌面应用">
    <meta property="og:type" content="article">
    <meta property="og:locale" content="cn">
    <meta property="og:title" content="ENERGY文档">
    <meta property="og:description" content="ENERGY是Go基于LCL和CEF(Chromium Embedded Framework)开发的GUI框架, 用于开发Windows、MacOS 和 Linux 跨平台桌面应用">
    <meta property="og:keywords" content="Energy,GoGUI,GolangGUI,桌面应用,跨平台GUI,跨平台桌面应用,开源GUI,GoCEF,GolangCEF,Go桌面应用,Golang桌面应用,Golang构建跨平台应用">
    <meta property="og:site_name" content="Go ENERGY">
    <meta property="google-site-verification" content="y1ft7YSwR6LAzQsR3s2OBajPkbLz16MDC809PgeHYfI">
    <meta property="og:image" content="https://energye.github.io/imgs/energy-277x156.png">
    <meta property="og:url" content="https://energye.github.io">
    <script>window._hmt=window._hmt||[],function(){let e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?5c579ee49a29203cd8dff7fa8eda5ac9";let t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}();</script>
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"dark",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-d8b57b2d><!--[--><!--]--><!--[--><span tabindex="-1" data-v-c8291ffa></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-c8291ffa> Skip to content </a><!--]--><!----><header class="VPNav" data-v-d8b57b2d data-v-7ad780c2><div class="VPNavBar has-sidebar top" data-v-7ad780c2 data-v-9fd4d1dd><div class="wrapper" data-v-9fd4d1dd><div class="container" data-v-9fd4d1dd><div class="title" data-v-9fd4d1dd><div class="VPNavBarTitle has-sidebar" data-v-9fd4d1dd data-v-0ad69264><a class="title" href="/en/" data-v-0ad69264><!--[--><!--]--><!--[--><img class="VPImage logo" src="/imgs/icon.png" width="24" height="24" alt data-v-ab19afbb><!--]--><span data-v-0ad69264>ENERGY</span><!--[--><!--]--></a></div></div><div class="content" data-v-9fd4d1dd><div class="content-body" data-v-9fd4d1dd><!--[--><!--]--><div class="VPNavBarSearch search" data-v-9fd4d1dd><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search Document"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search Document</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-9fd4d1dd data-v-afb2845e><span id="main-nav-aria-label" class="visually-hidden" data-v-afb2845e> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/en/course/getting-started" tabindex="0" data-v-afb2845e data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>Course</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/examples" tabindex="0" data-v-afb2845e data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>Examples</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/document" tabindex="0" data-v-afb2845e data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>Document</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-afb2845e data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-af5898d3><span class="text" data-v-af5898d3><!----><span data-v-af5898d3>2.5.6</span><span class="vpi-chevron-down text-icon" data-v-af5898d3></span></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-20ed86d6><div class="items" data-v-20ed86d6><!--[--><!--[--><div class="VPMenuLink" data-v-20ed86d6 data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/energye/energy/blob/main/UpdateLog.md" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Update Log<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-20ed86d6 data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://gitee.com/energye/energy/milestones/196997" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Version 3.0<!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://forum.yanghy.cn" target="_blank" rel="noreferrer" tabindex="0" data-v-afb2845e data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>Forum</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://sourceforge.net/projects/liblcl/files/" target="_blank" rel="noreferrer" tabindex="0" data-v-afb2845e data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>Download</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-afb2845e data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-af5898d3><span class="text" data-v-af5898d3><!----><span data-v-af5898d3>About</span><span class="vpi-chevron-down text-icon" data-v-af5898d3></span></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-20ed86d6><div class="items" data-v-20ed86d6><!--[--><!--[--><div class="VPMenuLink" data-v-20ed86d6 data-v-f51f088d><a class="VPLink link" href="/en/about/question" data-v-f51f088d><!--[-->Question<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-20ed86d6 data-v-f51f088d><a class="VPLink link" href="/en/about/support" data-v-f51f088d><!--[-->Donation<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-20ed86d6 data-v-f51f088d><a class="VPLink link" href="/en/about/contact" data-v-f51f088d><!--[-->Technical<!--]--></a></div><!--]--><!--[--><div class="VPMenuGroup" data-v-20ed86d6 data-v-a6b0397c><p class="title" data-v-a6b0397c>Other Project</p><!--[--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/energye/energy" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Go Energy<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/energye/lcl" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->LCL<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/energye/cef" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->CEF<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/energye/wv" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->WebView<!--]--></a></div><!--]--><!--]--></div><!--]--><!--[--><div class="VPMenuGroup" data-v-20ed86d6 data-v-a6b0397c><p class="title" data-v-a6b0397c>Acc Cert</p><!--[--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link" href="/en/about/honorcert" data-v-f51f088d><!--[-->Honor Cert<!--]--></a></div><!--]--><!--]--></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-9fd4d1dd data-v-acee064b data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-af5898d3><span class="text" data-v-af5898d3><span class="vpi-languages option-icon" data-v-af5898d3></span><!----><span class="vpi-chevron-down text-icon" data-v-af5898d3></span></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-20ed86d6><!----><!--[--><!--[--><div class="items" data-v-acee064b><p class="title" data-v-acee064b>English</p><!--[--><div class="VPMenuLink" data-v-acee064b data-v-f51f088d><a class="VPLink link" href="/course/build-liblcl" data-v-f51f088d><!--[-->中文<!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-9fd4d1dd data-v-3f90c1a5><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to light theme" aria-checked="true" data-v-3f90c1a5 data-v-be9742d9 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-be9742d9></span><span class="vpi-moon moon" data-v-be9742d9></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-9fd4d1dd data-v-ef6192dc data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://gitee.com/energye/energy" aria-label target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><svg t="1730863652667" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4281" width="200" height="200"><path d="M514.275556 512m-510.862223 0a510.862222 510.862222 0 1 0 1021.724445 0 510.862222 510.862222 0 1 0-1021.724445 0Z" fill="#C71D23" p-id="4282"></path><path d="M772.551111 455.111111H483.555556c-13.653333 0-25.031111 11.377778-25.031112 25.031111v62.577778c0 13.653333 11.377778 25.031111 25.031112 25.031111L659.911111 568.888889c13.653333 0 25.031111 11.377778 25.031111 25.031111v13.653333c0 42.097778-34.133333 75.093333-75.093333 75.093334h-238.933333c-13.653333 0-25.031111-11.377778-25.031112-25.031111v-238.933334c0-42.097778 34.133333-75.093333 75.093334-75.093333h352.711111c13.653333 0 25.031111-11.377778 25.031111-25.031111v-62.577778c0-13.653333-11.377778-25.031111-25.031111-25.031111H420.977778c-104.675556 0-188.871111 84.195556-188.871111 188.871111v352.711111c0 13.653333 11.377778 25.031111 25.031111 25.031111h372.053333c94.435556 0 170.666667-76.231111 170.666667-170.666666V480.142222c-1.137778-13.653333-12.515556-25.031111-27.306667-25.031111z" fill="#FFFFFF" p-id="4283"></path></svg></a><a class="VPSocialLink no-icon" href="https://gitcode.com/energye/energy" aria-label target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.059 5.80628C18.2234 5.71425 18.3973 5.61696 18.585 5.51037C18.6076 5.63327 18.6297 5.74058 18.6497 5.83784C18.685 6.00943 18.714 6.15059 18.728 6.29005C18.8392 7.50125 19.448 8.39222 20.3108 8.59286C21.5726 8.88583 22.7623 8.40159 23.4033 7.33318C24.1733 6.05123 23.839 4.4812 22.5279 3.53618C18.8826 0.907049 14.8777 0.18191 10.5636 1.44819C1.2616 4.1927 -1.92121 15.6199 4.68062 22.6274C7.50507 25.6249 11.0914 26.9182 15.1624 26.8204C20.3774 26.6979 24.1333 24.099 26.5309 19.5947C28.2308 16.3988 26.3829 12.9055 22.8439 12.1795C20.8227 11.7726 18.7559 11.6405 16.6993 11.7869C16.0151 11.8526 15.3509 12.0547 14.7459 12.3811C14.0691 12.7324 13.8734 13.4614 13.9493 14.1838C14.02 14.8421 14.5247 15.2369 15.1258 15.3362C16.3361 15.5256 17.5609 15.6357 18.7833 15.7361C19.1371 15.7659 19.4942 15.7694 19.8507 15.773C20.3623 15.7781 20.873 15.7832 21.3718 15.8657C22.7949 16.1009 23.2836 17.2557 22.5517 18.4911C22.3724 18.7882 22.1633 19.0662 21.9277 19.3209C20.9703 20.3738 19.7183 21.1144 18.3344 21.4465C15.8084 22.0649 13.2798 22.0996 10.7655 21.3054C7.90238 20.4021 6.19549 18.2991 6.13552 15.4682C6.1131 13.7223 6.55634 12.002 7.41963 10.4843C7.80967 9.77685 8.02376 9.04827 7.96359 8.24664C7.93826 7.90488 7.92423 7.56273 7.90915 7.19506C7.90113 6.99938 7.89281 6.79647 7.88233 6.58254C8.17231 6.6434 8.45871 6.72023 8.74022 6.81271C9.83531 7.2523 10.9132 7.45284 12.0986 7.13019C12.7728 6.96895 13.4697 6.92433 14.159 6.99829C15.269 7.08878 16.3785 6.81759 17.3215 6.22521C17.5569 6.08724 17.7963 5.9533 18.059 5.80628Z" fill="#DA203E"/></svg></a><a class="VPSocialLink no-icon" href="https://github.com/energye/energy" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-github" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-9fd4d1dd data-v-f953d92f data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-af5898d3><span class="vpi-more-horizontal icon" data-v-af5898d3></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-20ed86d6><!----><!--[--><!--[--><div class="group translations" data-v-f953d92f><p class="trans-title" data-v-f953d92f>English</p><!--[--><div class="VPMenuLink" data-v-f953d92f data-v-f51f088d><a class="VPLink link" href="/course/build-liblcl" data-v-f51f088d><!--[-->中文<!--]--></a></div><!--]--></div><div class="group" data-v-f953d92f><div class="item appearance" data-v-f953d92f><p class="label" data-v-f953d92f>Appearance</p><div class="appearance-action" data-v-f953d92f><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to light theme" aria-checked="true" data-v-f953d92f data-v-be9742d9 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-be9742d9></span><span class="vpi-moon moon" data-v-be9742d9></span><!--]--></span></span></button></div></div></div><div class="group" data-v-f953d92f><div class="item social-links" data-v-f953d92f><div class="VPSocialLinks social-links-list" data-v-f953d92f data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://gitee.com/energye/energy" aria-label target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><svg t="1730863652667" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4281" width="200" height="200"><path d="M514.275556 512m-510.862223 0a510.862222 510.862222 0 1 0 1021.724445 0 510.862222 510.862222 0 1 0-1021.724445 0Z" fill="#C71D23" p-id="4282"></path><path d="M772.551111 455.111111H483.555556c-13.653333 0-25.031111 11.377778-25.031112 25.031111v62.577778c0 13.653333 11.377778 25.031111 25.031112 25.031111L659.911111 568.888889c13.653333 0 25.031111 11.377778 25.031111 25.031111v13.653333c0 42.097778-34.133333 75.093333-75.093333 75.093334h-238.933333c-13.653333 0-25.031111-11.377778-25.031112-25.031111v-238.933334c0-42.097778 34.133333-75.093333 75.093334-75.093333h352.711111c13.653333 0 25.031111-11.377778 25.031111-25.031111v-62.577778c0-13.653333-11.377778-25.031111-25.031111-25.031111H420.977778c-104.675556 0-188.871111 84.195556-188.871111 188.871111v352.711111c0 13.653333 11.377778 25.031111 25.031111 25.031111h372.053333c94.435556 0 170.666667-76.231111 170.666667-170.666666V480.142222c-1.137778-13.653333-12.515556-25.031111-27.306667-25.031111z" fill="#FFFFFF" p-id="4283"></path></svg></a><a class="VPSocialLink no-icon" href="https://gitcode.com/energye/energy" aria-label target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.059 5.80628C18.2234 5.71425 18.3973 5.61696 18.585 5.51037C18.6076 5.63327 18.6297 5.74058 18.6497 5.83784C18.685 6.00943 18.714 6.15059 18.728 6.29005C18.8392 7.50125 19.448 8.39222 20.3108 8.59286C21.5726 8.88583 22.7623 8.40159 23.4033 7.33318C24.1733 6.05123 23.839 4.4812 22.5279 3.53618C18.8826 0.907049 14.8777 0.18191 10.5636 1.44819C1.2616 4.1927 -1.92121 15.6199 4.68062 22.6274C7.50507 25.6249 11.0914 26.9182 15.1624 26.8204C20.3774 26.6979 24.1333 24.099 26.5309 19.5947C28.2308 16.3988 26.3829 12.9055 22.8439 12.1795C20.8227 11.7726 18.7559 11.6405 16.6993 11.7869C16.0151 11.8526 15.3509 12.0547 14.7459 12.3811C14.0691 12.7324 13.8734 13.4614 13.9493 14.1838C14.02 14.8421 14.5247 15.2369 15.1258 15.3362C16.3361 15.5256 17.5609 15.6357 18.7833 15.7361C19.1371 15.7659 19.4942 15.7694 19.8507 15.773C20.3623 15.7781 20.873 15.7832 21.3718 15.8657C22.7949 16.1009 23.2836 17.2557 22.5517 18.4911C22.3724 18.7882 22.1633 19.0662 21.9277 19.3209C20.9703 20.3738 19.7183 21.1144 18.3344 21.4465C15.8084 22.0649 13.2798 22.0996 10.7655 21.3054C7.90238 20.4021 6.19549 18.2991 6.13552 15.4682C6.1131 13.7223 6.55634 12.002 7.41963 10.4843C7.80967 9.77685 8.02376 9.04827 7.96359 8.24664C7.93826 7.90488 7.92423 7.56273 7.90915 7.19506C7.90113 6.99938 7.89281 6.79647 7.88233 6.58254C8.17231 6.6434 8.45871 6.72023 8.74022 6.81271C9.83531 7.2523 10.9132 7.45284 12.0986 7.13019C12.7728 6.96895 13.4697 6.92433 14.159 6.99829C15.269 7.08878 16.3785 6.81759 17.3215 6.22521C17.5569 6.08724 17.7963 5.9533 18.059 5.80628Z" fill="#DA203E"/></svg></a><a class="VPSocialLink no-icon" href="https://github.com/energye/energy" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-github" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-9fd4d1dd data-v-6bee1efd><span class="container" data-v-6bee1efd><span class="top" data-v-6bee1efd></span><span class="middle" data-v-6bee1efd></span><span class="bottom" data-v-6bee1efd></span></span></button></div></div></div></div><div class="divider" data-v-9fd4d1dd><div class="divider-line" data-v-9fd4d1dd></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-d8b57b2d data-v-2488c25a><div class="container" data-v-2488c25a><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-2488c25a><span class="vpi-align-left menu-icon" data-v-2488c25a></span><span class="menu-text" data-v-2488c25a>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-2488c25a data-v-883964e0><button data-v-883964e0>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-d8b57b2d data-v-42c4c606><div class="curtain" data-v-42c4c606></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-42c4c606><span class="visually-hidden" id="sidebar-aria-label" data-v-42c4c606> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-51288d80><section class="VPSidebarItem level-0 collapsible" data-v-51288d80 data-v-edd2eed8><div class="item" role="button" tabindex="0" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><h2 class="text" data-v-edd2eed8>Introduction</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-edd2eed8><span class="vpi-chevron-right caret-icon" data-v-edd2eed8></span></div></div><div class="items" data-v-edd2eed8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/what-is-energy" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>What is energy？</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-51288d80><section class="VPSidebarItem level-0 collapsible" data-v-51288d80 data-v-edd2eed8><div class="item" role="button" tabindex="0" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><h2 class="text" data-v-edd2eed8>Start Using</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-edd2eed8><span class="vpi-chevron-right caret-icon" data-v-edd2eed8></span></div></div><div class="items" data-v-edd2eed8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/getting-started" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Getting Started</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/install-env" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Install Environment</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/install-sdk" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Use SDK Install Environment</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/download-version" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Download Version</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-51288d80><section class="VPSidebarItem level-0 collapsible" data-v-51288d80 data-v-edd2eed8><div class="item" role="button" tabindex="0" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><h2 class="text" data-v-edd2eed8>Energy CLI</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-edd2eed8><span class="vpi-chevron-right caret-icon" data-v-edd2eed8></span></div></div><div class="items" data-v-edd2eed8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-download" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Download CLI</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/build-package" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Package Build</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" tabindex="0" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/index" data-v-edd2eed8><!--[--><h3 class="text" data-v-edd2eed8>Use CLI</h3><!--]--></a><!----></div><div class="items" data-v-edd2eed8><!--[--><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-env" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>1. env</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-install" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>2. install</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-init" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>3. init</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-build" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>4. build</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-package" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>5. package</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-cli" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>6. cli</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-update" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>7. update</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/cli-use/cli-use-version" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>8. version</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-51288d80><section class="VPSidebarItem level-0 has-active" data-v-51288d80 data-v-edd2eed8><!----><div class="items" data-v-edd2eed8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-edd2eed8 data-v-edd2eed8><div class="item" data-v-edd2eed8><div class="indicator" data-v-edd2eed8></div><a class="VPLink link link" href="/en/course/build-liblcl" data-v-edd2eed8><!--[--><p class="text" data-v-edd2eed8>Build Liblcl</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-d8b57b2d data-v-9a6c75ad><div class="VPDoc has-sidebar has-aside" data-v-9a6c75ad data-v-e6f2a212><!--[--><!--]--><div class="container" data-v-e6f2a212><div class="aside" data-v-e6f2a212><div class="aside-curtain" data-v-e6f2a212></div><div class="aside-container" data-v-e6f2a212><div class="aside-content" data-v-e6f2a212><div class="VPDocAside" data-v-e6f2a212 data-v-cb998dce><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-cb998dce data-v-f610f197><div class="content" data-v-f610f197><div class="outline-marker" data-v-f610f197></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-f610f197>DIR</div><ul class="VPDocOutlineItem root" data-v-f610f197 data-v-53c99d69><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-cb998dce></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-e6f2a212><div class="content-container" data-v-e6f2a212><!--[--><!--]--><main class="main" data-v-e6f2a212><div style="position:relative;" class="vp-doc _en_course_build-liblcl" data-v-e6f2a212><div><h1 id="编译liblcl" tabindex="-1">编译liblcl <a class="header-anchor" href="#编译liblcl" aria-label="Permalink to &quot;编译liblcl&quot;">​</a></h1><h2 id="自己编译energy依赖的liblcl动态链接库" tabindex="-1">自己编译energy依赖的liblcl动态链接库 <a class="header-anchor" href="#自己编译energy依赖的liblcl动态链接库" aria-label="Permalink to &quot;自己编译energy依赖的liblcl动态链接库&quot;">​</a></h2><p>我的编译环境有限，无法编译出所有CEF支持的系统架构，如何自己编译liblcl动态链接库 目前energy提供了 Windows(32,64), Linux (AMD64, ARM64), MacOSX AMD64, MacOS (M1,M2) 平台liblcl动态链接库，除此之外你需要自己编译CEF所支持的平台</p><h2 id="正文" tabindex="-1">正文 <a class="header-anchor" href="#正文" aria-label="Permalink to &quot;正文&quot;">​</a></h2><p>liblcl 是使用 lazarus 开发的基于 CEF4Delphi 开源软件包，使用FPC(Free Pascal Compiler)编译器, 在编译liblcl之前需要成功安装或构建出lazbuild</p><h3 id="使用-git-clone-liblcl" tabindex="-1">使用 git clone liblcl <a class="header-anchor" href="#使用-git-clone-liblcl" aria-label="Permalink to &quot;使用 git clone liblcl&quot;">​</a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>git clone https://github.com/energye/liblcl.git</span></span></code></pre></div><ul><li>main分枝: 是liblcl最新版本, 目前落后CEF版本</li><li>其它分枝: 一搬是CEF最后支持特定情况的版本</li></ul><h3 id="方式一-安装lazarus-ide" tabindex="-1">方式一 安装lazarus-ide <a class="header-anchor" href="#方式一-安装lazarus-ide" aria-label="Permalink to &quot;方式一 安装lazarus-ide&quot;">​</a></h3><p>以下是<span style="color:red;">直接安装</span>lazarus-ide的方式编译liblcl 当前lazarus-ide最新稳定版本是2.2.6</p><h4 id="lazarus-ide-官网" tabindex="-1">lazarus-ide 官网 <a class="header-anchor" href="#lazarus-ide-官网" aria-label="Permalink to &quot;lazarus-ide 官网&quot;">​</a></h4><p><a href="https://www.lazarus-ide.org" target="_blank" rel="noreferrer">https://www.lazarus-ide.org</a></p><h4 id="lazarus-相关下载" tabindex="-1">lazarus 相关下载 <a class="header-anchor" href="#lazarus-相关下载" aria-label="Permalink to &quot;lazarus 相关下载&quot;">​</a></h4><ul><li>Lazarus <a href="https://sourceforge.net/projects/lazarus/files" target="_blank" rel="noreferrer">https://sourceforge.net/projects/lazarus/files</a></li><li>FPC <a href="https://sourceforge.net/projects/freepascal/files" target="_blank" rel="noreferrer">https://sourceforge.net/projects/freepascal/files</a></li></ul><h4 id="windows" tabindex="-1">Windows <a class="header-anchor" href="#windows" aria-label="Permalink to &quot;Windows&quot;">​</a></h4><h5 id="_1-下载lazarus-windows安装包-需要注意386和amd64" tabindex="-1">1. 下载lazarus windows安装包, 需要注意386和amd64 <a class="header-anchor" href="#_1-下载lazarus-windows安装包-需要注意386和amd64" aria-label="Permalink to &quot;1. 下载lazarus windows安装包, 需要注意386和amd64&quot;">​</a></h5><h5 id="_2-安装到你想安装的目录" tabindex="-1">2. 安装到你想安装的目录 <a class="header-anchor" href="#_2-安装到你想安装的目录" aria-label="Permalink to &quot;2. 安装到你想安装的目录&quot;">​</a></h5><h5 id="_3-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl" tabindex="-1">3. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl <a class="header-anchor" href="#_3-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl" aria-label="Permalink to &quot;3. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl&quot;">​</a></h5><h5 id="_4-进入liblcl目录-注意-你想使用的cef版本分枝" tabindex="-1">4. 进入liblcl目录，注意: 你想使用的CEF版本分枝 <a class="header-anchor" href="#_4-进入liblcl目录-注意-你想使用的cef版本分枝" aria-label="Permalink to &quot;4. 进入liblcl目录，注意: 你想使用的CEF版本分枝&quot;">​</a></h5><h5 id="_5-编译liblcl" tabindex="-1">5. 编译liblcl <a class="header-anchor" href="#_5-编译liblcl" aria-label="Permalink to &quot;5. 编译liblcl&quot;">​</a></h5><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>打开 CMD 并进入 liblcl 目录</span></span>
<span class="line"><span>1. 执行以下命令添加软件包</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild.exe --add-package-link .\src\3rd-party\richmemo\richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\richmemo\richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild.exe --add-package .\src\3rd-party\richmemo\ide\richmemo_design.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\richmemo\ide\richmemo_design.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild.exe --add-package .\src\3rd-party\ATFlatControls\atflatcontrols\atflatcontrols_package.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\ATFlatControls\atflatcontrols\atflatcontrols_package.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild.exe --add-package-link .\src\3rd-party\DCPcrypt\dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\DCPcrypt\dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild.exe --add-package .\src\3rd-party\DCPcrypt\dcpcrypt_laz.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\DCPcrypt\dcpcrypt_laz.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild.exe --add-package .\src\3rd-party\CEF4Delphi\packages\cef4delphi_lazarus.lpk</span></span>
<span class="line"><span>lazbuild.exe .\src\3rd-party\CEF4Delphi\packages\cef4delphi_lazarus.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>提示: 如果出现错误，请检查lazarus环境变量是否配置正确，检查当前运行命令是否在liblcl目录</span></span>
<span class="line"><span></span></span>
<span class="line"><span>2. 构建liblcl动态链接库</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild.exe -B --bm=Win64 &quot;src/liblcl.lpi&quot;</span></span>
<span class="line"><span></span></span>
<span class="line"><span>参数说明: </span></span>
<span class="line"><span>    --bm 指定编译模式, Windows提供了2种, 分别是 Win64, Win32</span></span>
<span class="line"><span>编译模式用于区分编译出的liblcl.dll是32位还是64位，也同时需要安装对应的lazarus-ide</span></span></code></pre></div><h5 id="_6-最后编译出的-liblcl-dll-在当前-系统登录用户-golcl-liblcl-dll-目录" tabindex="-1">6. 最后编译出的 liblcl.dll 在当前 系统登录用户\golcl\liblcl.dll 目录 <a class="header-anchor" href="#_6-最后编译出的-liblcl-dll-在当前-系统登录用户-golcl-liblcl-dll-目录" aria-label="Permalink to &quot;6. 最后编译出的 liblcl.dll 在当前 系统登录用户\golcl\liblcl.dll 目录&quot;">​</a></h5><p>例如: C:\Users\Administrator\golcl\liblcl.dll</p><h4 id="linux" tabindex="-1">Linux <a class="header-anchor" href="#linux" aria-label="Permalink to &quot;Linux&quot;">​</a></h4><h5 id="_1-下载lazarus-deb安装包-需要注意386和amd64" tabindex="-1">1. 下载lazarus deb安装包, 需要注意386和amd64 <a class="header-anchor" href="#_1-下载lazarus-deb安装包-需要注意386和amd64" aria-label="Permalink to &quot;1. 下载lazarus deb安装包, 需要注意386和amd64&quot;">​</a></h5><h5 id="_2-我们使用deb安装包-提供了3个deb安装包-全部下载" tabindex="-1">2. 我们使用deb安装包, 提供了3个deb安装包, 全部下载 <a class="header-anchor" href="#_2-我们使用deb安装包-提供了3个deb安装包-全部下载" aria-label="Permalink to &quot;2. 我们使用deb安装包, 提供了3个deb安装包, 全部下载&quot;">​</a></h5><p>分别是 lazarus-ide: lazarus-project_2.2.6-0_amd64.deb fpc命令工具: fpc-laz_3.2.2-210709_amd64.deb fpc源码: fpc-src_3.2.2-210709_amd64.deb</p><h5 id="_3-安装" tabindex="-1">3. 安装 <a class="header-anchor" href="#_3-安装" aria-label="Permalink to &quot;3. 安装&quot;">​</a></h5><p>双击安装或使用dpkg命令安装 安装顺序 1. fpc-laz 2. fpc-src 3. lazarus-project</p><h5 id="_4-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl" tabindex="-1">4. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl <a class="header-anchor" href="#_4-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl" aria-label="Permalink to &quot;4. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl&quot;">​</a></h5><h5 id="_5-进入liblcl目录-注意-你想使用的cef版本分枝" tabindex="-1">5. 进入liblcl目录，注意: 你想使用的CEF版本分枝 <a class="header-anchor" href="#_5-进入liblcl目录-注意-你想使用的cef版本分枝" aria-label="Permalink to &quot;5. 进入liblcl目录，注意: 你想使用的CEF版本分枝&quot;">​</a></h5><h5 id="_6-编译liblcl" tabindex="-1">6. 编译liblcl <a class="header-anchor" href="#_6-编译liblcl" aria-label="Permalink to &quot;6. 编译liblcl&quot;">​</a></h5><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>打开 terminal 并进入 liblcl 目录</span></span>
<span class="line"><span>1. 执行以下命令添加软件包</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>提示: 如果出现错误，请检查lazarus环境变量是否配置正确，检查当前运行命令是否在liblcl目录</span></span>
<span class="line"><span></span></span>
<span class="line"><span>2. 构建liblcl动态链接库</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild -B --bm=Linux64 --ws=gtk3 --lazarusdir=/lazarus-ide/install/path &quot;src/liblcl.lpi&quot;</span></span>
<span class="line"><span></span></span>
<span class="line"><span>参数说明: </span></span>
<span class="line"><span>    --bm 指定编译模式, Linux提供了2种, 分别是 Linux64, Linux32</span></span>
<span class="line"><span>    --ws 指定LCLWidgetType, Linux提供了2种，分别是 gtk2, gtk3</span></span>
<span class="line"><span>    --lazarusdir 指定lazarus-ide的安装目录</span></span>
<span class="line"><span>编译模式用于区分编译出的liblcl.so是32位还是64位，也同时需要安装对应的lazarus-ide</span></span>
<span class="line"><span>LCLWidgetType: 是因为CEF不同版本在linux下对gtk支持不同, CEF106是最后一个支持gtk2的版本, 以后默认都是gtk3</span></span></code></pre></div><h5 id="_7-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-so-目录" tabindex="-1">7. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.so 目录 <a class="header-anchor" href="#_7-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-so-目录" aria-label="Permalink to &quot;7. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.so 目录&quot;">​</a></h5><p>例如: ~/golcl/liblcl.so</p><h4 id="macosx" tabindex="-1">MacOSX <a class="header-anchor" href="#macosx" aria-label="Permalink to &quot;MacOSX&quot;">​</a></h4><h5 id="_1-下载lazarus安装包-需要注意386和64-energy仅支持64位" tabindex="-1">1. 下载lazarus安装包, 需要注意386和64, energy仅支持64位 <a class="header-anchor" href="#_1-下载lazarus安装包-需要注意386和64-energy仅支持64位" aria-label="Permalink to &quot;1. 下载lazarus安装包, 需要注意386和64, energy仅支持64位&quot;">​</a></h5><h5 id="_2-提供了3个安装包-全部下载" tabindex="-1">2. 提供了3个安装包, 全部下载 <a class="header-anchor" href="#_2-提供了3个安装包-全部下载" aria-label="Permalink to &quot;2. 提供了3个安装包, 全部下载&quot;">​</a></h5><p>分别是 lazarus-ide: Lazarus-2.2.6-0-x86_64-macosx.pkg fpc命令工具: fpc-3.2.2.intelarm64-macosx.dmg fpc源码: fpc-src-3.2.2-20210709-macosx.dmg</p><h5 id="_3-安装-1" tabindex="-1">3. 安装 <a class="header-anchor" href="#_3-安装-1" aria-label="Permalink to &quot;3. 安装&quot;">​</a></h5><p>双击安装或使用命令安装 安装顺序 1. fpc 2. fpc-src 3. lazarus-project</p><h5 id="_4-进入liblcl目录-注意-你想使用的cef版本分枝-1" tabindex="-1">4. 进入liblcl目录，注意: 你想使用的CEF版本分枝 <a class="header-anchor" href="#_4-进入liblcl目录-注意-你想使用的cef版本分枝-1" aria-label="Permalink to &quot;4. 进入liblcl目录，注意: 你想使用的CEF版本分枝&quot;">​</a></h5><h5 id="_5-编译liblcl-1" tabindex="-1">5. 编译liblcl <a class="header-anchor" href="#_5-编译liblcl-1" aria-label="Permalink to &quot;5. 编译liblcl&quot;">​</a></h5><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>打开 terminal 并进入 liblcl 目录</span></span>
<span class="line"><span>1. 执行以下命令添加软件包</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>提示: 如果出现错误，请检查lazarus是否正确安装，检查当前运行命令是否在liblcl目录</span></span>
<span class="line"><span></span></span>
<span class="line"><span>2. 构建liblcl动态链接库</span></span>
<span class="line"><span></span></span>
<span class="line"><span>编译AMD64</span></span>
<span class="line"><span>lazbuild -B --bm=&quot;MacOS64(cocoa)&quot; --ws=cocoa &quot;src/liblcl.lpi&quot;</span></span>
<span class="line"><span>编译ARM64(M1 M2)平台</span></span>
<span class="line"><span>lazbuild -B --bm=&quot;MacOS64(cocoa)ARM64&quot; --ws=cocoa &quot;src/liblcl.lpi&quot;</span></span>
<span class="line"><span></span></span>
<span class="line"><span>参数说明: </span></span>
<span class="line"><span>    --bm 指定编译模式, MacOS提供了2种, 分别是 MacOS64(cocoa)ARM64, MacOS64(cocoa)</span></span>
<span class="line"><span>    --ws 指定LCLWidgetType = cocoa</span></span>
<span class="line"><span>    --lazarusdir 指定lazarus-ide的安装目录</span></span>
<span class="line"><span>编译模式 分别为AMD64和ARM64, 可在同一平台交叉编译</span></span>
<span class="line"><span>LCLWidgetType: 固定值 cocoa</span></span></code></pre></div><h5 id="_6-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-dylib-目录" tabindex="-1">6. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.dylib 目录 <a class="header-anchor" href="#_6-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-dylib-目录" aria-label="Permalink to &quot;6. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.dylib 目录&quot;">​</a></h5><p>例如: ~/golcl/liblcl.dylib</p><h3 id="方式二-自己编译lazarus-ide" tabindex="-1">方式二 自己编译lazarus-ide <a class="header-anchor" href="#方式二-自己编译lazarus-ide" aria-label="Permalink to &quot;方式二 自己编译lazarus-ide&quot;">​</a></h3><p>因lazarus有些平台未提供安装包，我们使用 源码+FPC工具 自己编译，这里使用linux-aarch64，其它平台照搬，基本差不多 我使用的是 lazarus-2.2.6-0.tar.gz， fpc-3.2.2.aarch64-linux.tar，fpc-3.2.2.source.tar.gz</p><p>先安装一些必备软件工具包</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>apt-get update -q -y</span></span>
<span class="line"><span>apt-get install -q -y git</span></span>
<span class="line"><span>apt-get install -q -y make binutils build-essential gdb subversion zip unzip libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libgtk-3-dev</span></span></code></pre></div><h4 id="_1-下载源码-注意版本匹配-目前lazarus-2-2-2-2-2-4-2-2-6-使用-fpc-3-2-2" tabindex="-1">1. 下载源码 注意版本匹配, 目前lazarus (2.2.2, 2.2.4, 2.2.6) 使用 FPC 3.2.2 <a class="header-anchor" href="#_1-下载源码-注意版本匹配-目前lazarus-2-2-2-2-2-4-2-2-6-使用-fpc-3-2-2" aria-label="Permalink to &quot;1. 下载源码 注意版本匹配, 目前lazarus (2.2.2, 2.2.4, 2.2.6) 使用 FPC 3.2.2&quot;">​</a></h4><ul><li>Lazarus源码: <a href="https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip" target="_blank" rel="noreferrer">https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/</a></li><li>FPC工具: <a href="https://sourceforge.net/projects/freepascal/files/Linux" target="_blank" rel="noreferrer">https://sourceforge.net/projects/freepascal/files/Linux</a></li><li>FPC源码: <a href="https://sourceforge.net/projects/freepascal/files/Source" target="_blank" rel="noreferrer">https://sourceforge.net/projects/freepascal/files/Source</a></li></ul><h4 id="_2-将压缩包内容解压出来" tabindex="-1">2. 将压缩包内容解压出来 <a class="header-anchor" href="#_2-将压缩包内容解压出来" aria-label="Permalink to &quot;2. 将压缩包内容解压出来&quot;">​</a></h4><p><code>tar -xvf lazarus-2.2.6-0.tar.gz -C ~/app</code><code>tar -xvf fpc-3.2.2.aarch64-linux.tar -C ~/app/lazarus</code><code>tar -xvf fpc-3.2.2.source.tar.gz -C ~/app/lazarus</code></p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>先解压 lazarus</span></span>
<span class="line"><span>接着解压 FPC工具 和 FPC源码 到 lazarus 目录</span></span>
<span class="line"><span>~/app/lazarus </span></span>
<span class="line"><span>  lazarus-2.2.6-0 // lazarus源码</span></span>
<span class="line"><span>  fpc-3.2.2.aarch64-linux // FPC工具</span></span>
<span class="line"><span>  fpc-3.2.2 // FPC源码</span></span></code></pre></div><h4 id="_3-开始安装" tabindex="-1">3. 开始安装 <a class="header-anchor" href="#_3-开始安装" aria-label="Permalink to &quot;3. 开始安装&quot;">​</a></h4><pre><code>- 进入 ~/app/lazarus/fpc-3.2.2.aarch64-linux 目录
- 执行 ./install.sh 脚本, 会提示输入，直接一路回车即可
- 返回到上级目录 cd ../
- 执行 make clean all
  如果有错误根据提示自己修改，应该不会出现错误，我是没遇到错误。
</code></pre><h4 id="_4-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl-1" tabindex="-1">4. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl <a class="header-anchor" href="#_4-配置lazarus安装目录到path环境变量-以使用lazbuild命令编译liblcl-1" aria-label="Permalink to &quot;4. 配置lazarus安装目录到PATH环境变量, 以使用lazbuild命令编译liblcl&quot;">​</a></h4><h4 id="_5-进入liblcl目录-注意-你想使用的cef版本分枝-1" tabindex="-1">5. 进入liblcl目录，注意: 你想使用的CEF版本分枝 <a class="header-anchor" href="#_5-进入liblcl目录-注意-你想使用的cef版本分枝-1" aria-label="Permalink to &quot;5. 进入liblcl目录，注意: 你想使用的CEF版本分枝&quot;">​</a></h4><h4 id="_6-编译liblcl-1" tabindex="-1">6. 编译liblcl <a class="header-anchor" href="#_6-编译liblcl-1" aria-label="Permalink to &quot;6. 编译liblcl&quot;">​</a></h4><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>打开 terminal 并进入 liblcl 目录</span></span>
<span class="line"><span>1. 执行以下命令添加软件包</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>提示: 如果出现错误，请检查lazarus环境变量是否配置正确，检查当前运行命令是否在liblcl目录</span></span>
<span class="line"><span></span></span>
<span class="line"><span>2. 构建liblcl动态链接库</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild -B --bm=Linux64 --ws=gtk3 --lazarusdir=/lazarus-ide/install/path &quot;src/liblcl.lpi&quot;</span></span>
<span class="line"><span></span></span>
<span class="line"><span>参数说明: </span></span>
<span class="line"><span>    --bm 指定编译模式, Linux提供了2种, 分别是 Linux64, Linux32</span></span>
<span class="line"><span>    --ws 指定LCLWidgetType, Linux提供了2种，分别是 gtk2, gtk3</span></span>
<span class="line"><span>    --lazarusdir 指定lazarus-ide的安装目录</span></span>
<span class="line"><span>编译模式用于区分编译出的liblcl.so是32位还是64位，也同时需要安装对应的lazarus-ide</span></span>
<span class="line"><span>LCLWidgetType: 是因为CEF不同版本在linux下对gtk支持不同, CEF106是最后一个支持gtk2的版本, 以后默认都是gtk3</span></span></code></pre></div><h4 id="_7-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-so-目录-1" tabindex="-1">7. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.so 目录 <a class="header-anchor" href="#_7-最后编译出的-liblcl-so-在当前-系统登录用户-golcl-liblcl-so-目录-1" aria-label="Permalink to &quot;7. 最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.so 目录&quot;">​</a></h4><p>例如: ~/golcl/liblcl.so</p><hr><h2 id="loongnix-龙芯" tabindex="-1">Loongnix 龙芯 <a class="header-anchor" href="#loongnix-龙芯" aria-label="Permalink to &quot;Loongnix 龙芯&quot;">​</a></h2><p>我没有Loongnix(龙芯)机器无法测试，龙芯工程师对lazarus做了支持, 理论上可以编译出liblcl。</p><h3 id="安装lazarus" tabindex="-1">安装lazarus <a class="header-anchor" href="#安装lazarus" aria-label="Permalink to &quot;安装lazarus&quot;">​</a></h3><p>相关链接</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>龙芯CEF: http://www.loongnix.cn/zh/api/CEF/  CEF 109 或 与energy有对应的版本</span></span>
<span class="line"><span>龙芯Go:  http://www.loongnix.cn/zh/toolchain/Golang/</span></span>
<span class="line"><span></span></span>
<span class="line"><span>方式一 在线安装 fpcupdeluxe - 支持各种平台在线安装lazarus-ide</span></span>
<span class="line"><span>   https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases  </span></span>
<span class="line"><span>   下载 fpcupdeluxe-loongarch64-linux</span></span>
<span class="line"><span></span></span>
<span class="line"><span>方式二 龙芯在线仓库 - 有能力自己编译</span></span>
<span class="line"><span>   仓库: http://pkg.loongnix.cn/</span></span>
<span class="line"><span>   fpc:  http://pkg.loongnix.cn/loongnix/pool/main/f/fpc/</span></span>
<span class="line"><span>   lazarus: http://pkg.loongnix.cn/loongnix/pool/main/l/lazarus/</span></span>
<span class="line"><span></span></span>
<span class="line"><span>方式三 龙芯lazarus绿色安装包和教程 - 推荐</span></span>
<span class="line"><span>   https://www.cnblogs.com/qiufeng2014/p/17197981.html</span></span></code></pre></div><h3 id="编译liblcl-1" tabindex="-1">编译liblcl <a class="header-anchor" href="#编译liblcl-1" aria-label="Permalink to &quot;编译liblcl&quot;">​</a></h3><p>编译步骤，除了lazarus安装方式不同，构建liblcl时命令和上面的教程一样, 如果你已尝试或有问题可以与我沟通。</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>打开 terminal 并进入 liblcl 目录</span></span>
<span class="line"><span>1. 执行以下命令添加软件包</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/richmemopackage.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/richmemo/ide/richmemo_design.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/ATFlatControls/atflatcontrols/atflatcontrols_package.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package-link ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt.lpk</span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/DCPcrypt/dcpcrypt_laz.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild --add-package ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span>lazbuild ./src/3rd-party/CEF4Delphi/packages/cef4delphi_lazarus.lpk</span></span>
<span class="line"><span></span></span>
<span class="line"><span>提示: 如果出现错误，请检查lazarus环境变量是否配置正确，检查当前运行命令是否在liblcl目录</span></span>
<span class="line"><span></span></span>
<span class="line"><span>2. 构建liblcl动态链接库</span></span>
<span class="line"><span></span></span>
<span class="line"><span>lazbuild -B --bm=Linux64 --ws=gtk3 --lazarusdir=/lazarus-ide/install/path &quot;src/liblcl.lpi&quot;</span></span></code></pre></div><p>最后编译出的 liblcl.so 在当前 系统登录用户/golcl/liblcl.so 目录 例如: ~/golcl/liblcl.so</p></div></div></main><footer class="VPDocFooter" data-v-e6f2a212 data-v-1bcd8184><!--[--><!--]--><div class="edit-info" data-v-1bcd8184><div class="edit-link" data-v-1bcd8184><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/energye/energye.github.io/tree/main/en/course/build-liblcl.md" target="_blank" rel="noreferrer" data-v-1bcd8184><!--[--><span class="vpi-square-pen edit-link-icon" data-v-1bcd8184></span> Edit this page on GitHub<!--]--></a></div><div class="last-updated" data-v-1bcd8184><p class="VPLastUpdated" data-v-1bcd8184 data-v-1bb0c8a8>Last updated: <time datetime="2024-09-09T14:00:10.000Z" data-v-1bb0c8a8></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-1bcd8184><span class="visually-hidden" id="doc-footer-aria-label" data-v-1bcd8184>Pager</span><div class="pager" data-v-1bcd8184><a class="VPLink link pager-link prev" href="/en/course/cli-use/cli-use-version" data-v-1bcd8184><!--[--><span class="desc" data-v-1bcd8184>Previous page</span><span class="title" data-v-1bcd8184>8. version</span><!--]--></a></div><div class="pager" data-v-1bcd8184><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-d8b57b2d data-v-566314d4><div class="container" data-v-566314d4><p class="message" data-v-566314d4><span style="color: #2ba9f1;">GO<br>ENERGY</span></p><p class="copyright" data-v-566314d4>Copyright © 2022-2025 YangHY</p></div></footer><!--[--><!--]--></div></div>
    
    
  </body>
</html>